home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Shareware Grab Bag
/
Shareware Grab Bag.iso
/
007
/
tasking.arc
/
DOSLOCK.MOD
< prev
next >
Wrap
Text File
|
1986-05-21
|
715b
|
31 lines
IMPLEMENTATION MODULE DOSlock;
FROM SYSTEM IMPORT SETREG, GETREG, AX, BX, ES, SWI, ADDRESS;
FROM Locks IMPORT LockType, Unlock, Lock;
VAR
criticalSectionPtr: POINTER TO CARDINAL;
aux: ADDRESS;
lock: LockType;
PROCEDURE LockDOS;
BEGIN
Lock(lock);
IF criticalSectionPtr^ # 0 THEN HALT END;
END LockDOS;
PROCEDURE UnlockDOS;
BEGIN
IF criticalSectionPtr^ # 0 THEN HALT END;
Unlock(lock);
END UnlockDOS;
BEGIN
Unlock(lock);
SETREG(AX, 3400H); (* undocumented dos call from page 15-11 of Logitech v2 *)
SWI(21H);
GETREG(ES, aux.SEGMENT);
GETREG(BX, aux.OFFSET);
criticalSectionPtr := aux;
END DOSlock.